import '../css/common.less';
import '../css/question.less';
document.body.addEventListener('touchstart', function () {});

let isAnswer = false;
$('ul').on('click','li',function(){
    if(isAnswer) {
        return;
    }
    isAnswer = true;
    let $this= $(this);
    if($this.find('p').attr('data-true') == 'true') {
        showRight();
    }else {
        $this.addClass('isWrong shake');
        $('#yours').addClass('isWrong');
        showRight();
    }
    showAnswer($this);
});
function showRight() {
    $('ul').find('li').each(function() {
        if($(this).find('p').attr('data-true') == 'true') {
            $(this).addClass('isRight');
            $('#rightAnswer').text($(this).find('em').text());
        }
    });
}
function showAnswer($this) {
    $('#yours').text($this.find('em').text());
    $('.choose').addClass('showAnswer');
}